package com.weiyuwqj.server.service.finance.module.action;

import com.weiyuwqj.api.model.SysAmountOperate;

import java.math.BigDecimal;

/**
 * Created by Administrator on 2017/4/26.
 */
public abstract class AbstractOperateAction implements OperateAction{
    protected SysAmountOperate amountOperate;

    public AbstractOperateAction() {
        this.amountOperate = new SysAmountOperate();
    }

    public SysAmountOperate getAmountOperate() {
        return amountOperate;
    }

    public void setAmountOperate(SysAmountOperate amountOperate) {
        this.amountOperate = amountOperate;
    }

    @Override
    public void operateAction(String orderNo,String operateType,Integer itemId,String itemName,BigDecimal operateAmount){
        init(orderNo, operateType, itemId, itemName);
        changeAmount(operateAmount);
    }
    public void init(String orderNo,String operateType,Integer itemId,String itemName){
        amountOperate.setOrderNo(orderNo);
        amountOperate.setOperateType(operateType);
        amountOperate.setAssetName(String.valueOf(itemId));
        amountOperate.setItemName(itemName);
    }
    public abstract void changeAmount(BigDecimal operateAmount);
}
